package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.TProdRecord;
import com.ruoyi.system.domain.dto.TProdRecordDTO;
import com.ruoyi.system.domain.vo.PieVO;
import com.ruoyi.system.domain.vo.ProdYearTotalVO;
import com.ruoyi.system.domain.vo.TProdRecordVO;
import com.ruoyi.system.domain.vo.TProdTaskVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author wux
 * @date 2023/5/30 9:09
 */
@Mapper
public interface TProdRecordMapper extends BaseMapper<TProdRecord> {
    List<TProdRecordVO> listByPage(TProdRecordDTO params);

    TProdTaskVO getRecordByProd(Long prodId);

    int sumRecord(Long projectId);

    int sumYearRecord(Long projectId);

    int sumMonthRecord(Long projectId);

    int sumDayRecord(Long projectId);

    List<PieVO> groupProd(Long projectId);

    List<ProdYearTotalVO> groupYear(Long projectId);

    List<PieVO> groupMonth(@Param(value = "projectId")Long projectId, @Param(value = "year")String year);

    List<PieVO> groupDay(@Param(value = "projectId")Long projectId, @Param(value = "monthDate")String monthDate);

    int sumXYearRecord(@Param(value = "projectId")Long projectId, @Param(value = "year")String year);

    int sumXMonthRecord(@Param(value = "projectId")Long projectId, @Param(value = "monthDate")String monthDate);

    List<Map<String,Object>> getTaskRecordByDay();

    List<TProdRecordVO> getByBatchCode(TProdRecordDTO params);

    List<TProdRecordVO> getByBatchCode2(TProdRecordDTO params);

    int sumByProd(Long prodId);
}
